// 封装面包屑数据业务相关代码
import { getCategoryFilterAPI } from '@/apis/category'
import { useRoute } from 'vue-router'
import { onMounted, ref } from 'vue'

export function useTabs() {
  // 获取面包屑导航数据
  const route = useRoute()
  const filterData = ref({})
  const getFilterData = async () => {
    const res = await getCategoryFilterAPI(route.params.id)
    filterData.value = res.result
  }

  onMounted(() => getFilterData())

  return {
    filterData
  }
}
